// DebugDlg.cpp : implementation file
//

#include "stdafx.h"
#include "dhl_yk.h"
#include "DebugDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDebugDlg dialog

CDebugDlg* debugDlg;

CDebugDlg::CDebugDlg(CWnd* pParent)
	: CDialog(CDebugDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDebugDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	debugDlg = NULL;

}

CDebugDlg::~CDebugDlg()
{
	if(debugDlg != NULL) delete debugDlg;   
}

void CDebugDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDebugDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDebugDlg, CDialog)
	//{{AFX_MSG_MAP(CDebugDlg)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDebugDlg message handlers

BOOL CDebugDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDebugDlg::showLog(char* TAG, char * lpDate)
{
	if (debugDlg == NULL) return;

	CString s1;
	GetDlgItemText(IDC_EDIT_CLIENT, s1);
	s1 += "\r\n";
	s1 += TAG;
	s1 += ": ";
	s1 += lpDate;
	SetDlgItemText(IDC_EDIT_CLIENT, s1);
}

void CDebugDlg::OnSize(UINT nType, int cx, int cy) 
{
	CDialog::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	CWnd *pWnd1; 
	CRect rect1;
	pWnd1 = GetDlgItem(IDC_EDIT_CLIENT);
	if (pWnd1)
	{	
		pWnd1->GetWindowRect(&rect1);
		ScreenToClient(&rect1);
		pWnd1->SetWindowPos(NULL, 0, 0, cx, cy - rect1.top, SWP_NOZORDER|SWP_NOMOVE);
	}

}
